<template>
  <div>
    <van-nav-bar title="相似商品" left-arrow @click-left="onClickLeft" />
    <div>
      <van-card
        price="99"
        desc="匠心精选，颗颗饱满"
        title="金银花 统货"
        thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
      >
      </van-card>
    </div>
    <h3>相似好货 为你推荐</h3>
    <!-- 商品渲染 -->
    <div>
      <ul>
        <li v-for="item in goodsLists" :key="item.id">
          <img src="@/assets/金银花.jpg" alt="" />
          <p class="username">{{ item.name }}</p>
          <p class="introduce">{{ item.introduce }}</p>
          <p class="price">￥{{ item.price }}</p>
        </li>
      </ul>
    </div>
    <!-- 加载更多 -->
    <Loading></Loading>
  </div>
</template>

<script>
import Loading from "@/components/bottom_loading";
export default {
  name: "KuangjiaSimilarGoods",

  data() {
    return {
      goodsLists: this.$store.state.list,
    };
  },
  components: {
    Loading,
  },
  mounted() {},

  methods: {
    onClickLeft() {
      this.$router.back(-1);
    },
  },
};
</script>

<style lang="less" scoped>
// 导航栏
.van-nav-bar {
  background-color: #f9f9f9;
  /deep/ .van-nav-bar__title {
    color: #a3998d;
  }
}
// 卡片背景颜色
.van-card {
  background-color: #fff;
  // 价格颜色
  .van-card__price {
    color: #e7637a;
  }
}

.van-card__desc {
  color: #dfdfdf;
  line-height: 30px;
}
.van-card__title {
  line-height: 25px;
}
// 相似好货
h3 {
  text-align: center;
  height: 76px;
  color: #99999a;
  background-color: #f9f9f9;
  line-height: 76px;
}
// 商品渲染
ul {
  display: flex;
  justify-content: space-between;
  flex-flow: wrap;
  padding: 0 35px;
  box-sizing: border-box;
  li {
    width: 34%;
    padding: 16px 10px;
    text-align: center;
    img {
      width: 90px;
      height: 90px;
      height: 100px;
    }
    p {
      padding: 3px 0;
    }
    .introduce {
      font-size: 13px;
      color: #cccccd;
    }
    // 商品价格
    .price {
      color: red;
    }
  }
}
// 下方loading图
.loading {
  padding: 80px 0 0 0;
  height: 200px;
  background-color: #f9f9f9;
  text-align: center;
  img {
    width: 30px;
    height: 30px;
  }
  p {
    padding: 10px 0 0 0;
    color: #d2cecc;
  }
}
</style>